package Vector;

import java.util.Scanner;
import java.util.Vector;

public class ScoreTest {
    public static void main(String[] args) {
        Vector v=new Vector();
        Scanner sc=new Scanner(System.in);
        int maxScore=0;
        while (true){
            System.out.println("请输入学生成绩");
            int intScore= sc.nextInt();
            
            if(intScore<0){
                System.out.println("最高成绩 "+maxScore);
                break;
            }
            
//            Integer score = Integer.valueOf(intScore);
//            v.addElement(score);
            v.addElement(intScore);
//            if(maxScore<intScore){
//                maxScore=intScore;
//            }
            maxScore=maxScore<intScore?intScore:maxScore;
        }
        for (int i = 0; i < v.size(); i++) {
            Object objScore = v.elementAt(i);
//            Integer intScore=(Integer) objScore;
//            int score=intScore.intValue();
            int score=(Integer) objScore;
            char grade=' ';
            int dif=maxScore-score;
            if(dif<=10){
                grade='A';
            } else if (dif<=20) {
                grade='B';
            }else if (dif<=30){
                grade='C';
            }else {
                grade='D';
            }
            System.out.println("student "+i+" score "+score+" grade "+grade);
        }
        



        sc.close();
    }
}
